package com.example.demo.app;

import com.example.demo.domain.base.BaseResult;
import com.example.demo.domain.vo.SysDictInfoVO;
import com.example.demo.service.SysDictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Config
 *
 * @author haochen78
 * @date 2025/11/6 11:04
 **/
@RestController
@RequestMapping("/app/config")
public class ConfigController {

    @Autowired
    private SysDictService sysDictService;

    @GetMapping("/values")
    public BaseResult<List<SysDictInfoVO>> getConfigs(@RequestParam String type) {
        return BaseResult.success(sysDictService.getDictByType(type));
    }
}
